package com.sdx.console.content.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.content.dao.ResColumnDao;
import com.sdx.console.content.entity.ResColumn;
import com.ibeetl.admin.core.service.BaseService;

/**
 * 栏目管理 Service
 */

@Service
@Transactional
public class ResColumnService extends BaseService<ResColumn>{

    @Resource
	private ResColumnDao resColumnDao;

    public PageQuery<ResColumn>queryByCondition(PageQuery query){
        PageQuery ret =  resColumnDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelResColumn(List<String> ids){
        try {
            resColumnDao.batchDelResColumnByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除栏目管理失败", e);
        }
    }

	public List<ResColumn> all() {
		return resColumnDao.all();
		}

    public List<ResColumn>  queryColumnList(String moduleId, String provinceId) {
        try {
            return resColumnDao.queryColumnList(moduleId,provinceId);
        } catch (Exception e) {
            throw new PlatformException("查询栏目管理失败", e);
        }
    }


}